package ru.nsu.fit.client.core;

import java.util.HashSet;
import java.util.Set;

public class KernelConfig {
    private static KernelConfig defaultConfig = new KernelConfig();

    private final Set<String> supportedVersions = new HashSet<String>();
    private String serverUrl = "";

    static {
        defaultConfig.supportedVersions.add("1.0");
        defaultConfig.serverUrl = "http://localhost:8080/ws/";
    }

    public void addSupportedVersion(String version)
    {
        supportedVersions.add(version);
    }

    public boolean isVersionSupported(final String version)
    {
        return supportedVersions.contains(version);
    }

    public static KernelConfig getDefault()
    {
        return defaultConfig;
    }

    public String getServerUrl() {
        return serverUrl;
    }

    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }
}
